#!/usr/bin/perl -w
use 5.010;

print "Would you like to play a game?";
chomp($_=<STDIN>);
if(/yes/i){
	print "In that case, I recommend that you go bowling.\n";
}

$_="I saw Barney\ndown at the bowling alley\nwith fred\nlast night.\n";
if(/Barney.*fred/s){
	print "That string mentions fred after Barney!\n";
}
if(m{
	 barney
	 .*
	 fred
	 }six){
	 print "That string mentions Fred after Barney!\n";
	 }
	 
my $some_other="I dream of betty rubble.";
if($some_other=~/\brub/){
	print "Aye,there's the rub.\n";
}

print "Do you like Perl?";
my $likes_perl=(<STDIN>=~/\byes\b/i);
if($likes_perl){
	print "You said earlier that you like Perl,so...\n";
}
